from tortoise import fields

from app.models.mixins import BaseModel
from app.schemas.enums import WeatherEnum


class Weather(BaseModel):
    id = fields.BigIntField(pk=True)
    temperature = fields.FloatField()
    humidity = fields.FloatField()
    wind_speed = fields.FloatField()
    weather_condition = fields.CharEnumField(WeatherEnum)
    precipitation_amount = fields.FloatField()
    measurement_date_time = fields.DatetimeField()
    weather_forecasts = fields.ReverseRelation["models.WeatherForecast"]

    class Meta:
        table = "weather"
